package com.hr.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hr.entity.ConfigMajorKind;
import com.hr.mapper.ConfigMajorKindMapper;
import com.hr.service.ConfigMajorKindService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ConfigMajorKindServiceImpl implements ConfigMajorKindService {
    @Autowired
    private ConfigMajorKindMapper configMajorKindMapper;

    /**
     * 查询
     *
     * @return
     */
    @Override
    public List<ConfigMajorKind> queryList() {
        return configMajorKindMapper.selectList(new QueryWrapper<ConfigMajorKind>());
    }

    /**
     * 保存/修改
     *
     * @param configMajorKind
     * @return
     */
    @Override
    public boolean save(ConfigMajorKind configMajorKind) {
        int row = 0;
        if (configMajorKind.getMfkid() == null) {
            row = configMajorKindMapper.insert(configMajorKind);
        } else {
            row = configMajorKindMapper.updateById(configMajorKind);
        }
        return row > 0;
    }

    /**
     * 删除
     *
     * @param mfkid
     * @return
     */
    @Override
    public boolean del(Integer mfkid) {
        int i = configMajorKindMapper.deleteById(mfkid);
        return i > 0;

    }
//    /**
//     * 职位分类 的业务
//     */
//    @Override
//    public List<ConfigMajorKind> queryList() {
//        QueryWrapper<ConfigMajorKind> queryWrapper = new QueryWrapper<ConfigMajorKind>();
//        List<ConfigMajorKind> list = configMajorKindMapper.selectList(queryWrapper);
//        return list;
//
//    }

}
